package com.movitech.mobile.cz.base.bizconfig.service;

import com.baomidou.mybatisplus.service.IService;
import com.movitech.mobile.cz.base.bizconfig.entity.SSuppliersCategory;
import com.movitech.mobile.cz.base.bizconfig.entity.ext.ExtSSuppliersCategory;
import com.movitech.mobile.cz.base.modules.controller.RestReturnResult;
import com.movitech.mobile.cz.base.sys.bizvo.SuppliersCategoryFindRequest;
import com.movitech.mobile.cz.base.sys.bizvo.SuppliersCategoryRequestVO;

import java.util.List;

/**
 * <p>
 * 供应商分类 服务类
 * </p>
 *
 * @author Movitech Mobile
 * @since 2018-02-28
 */
public interface SSuppliersCategoryService extends IService<SSuppliersCategory> {

    List<ExtSSuppliersCategory> selectByCode(String code);


    /**
     * 供应商分类树
     *
     * @return
     */
    public RestReturnResult<Object> getSuppliersCategoryTree();

    /**
     * 供应商分类新增/修改
     *
     * @param suppliersCategoryRequestVO
     * @return
     */
    public RestReturnResult<Object> saveOrUpdateSuppliersCategory(SuppliersCategoryRequestVO suppliersCategoryRequestVO);

    /**
     * 供应商删除
     *
     * @param id
     * @return
     */
    public RestReturnResult<Object> updateSuppliersCategoryForDel(String id);

    /**
     * 供应商分类 停用/启用
     *
     * @param suppliersCategoryRequestVO
     * @return
     */
    public RestReturnResult<Object> updateSuppliersCategoryStatus(SuppliersCategoryRequestVO suppliersCategoryRequestVO);


    /**
     * 根据供应商分类id查询分类名称
     *
     * @param supplierCategoryIdArr
     * @return
     */
    public String getSupplierCategoryNames(String[] supplierCategoryIdArr);

    /**
     * 获取一级分类名称
     *
     * @param categoryIds 分类ID，逗号分隔
     * @return
     */
    String getRootSupplierCategoryNames(String categoryIds);


    /**
     * 根据最低level获取供应商分类树
     *
     * @param level
     * @return
     */
    public RestReturnResult<Object> getSuppliersCategoryTreeByLevel(String level);


    RestReturnResult<Object> findSuppliersCategoryTreeList(SuppliersCategoryFindRequest suppliersCategoryFindRequest);

    List<String> selectShowIdsByParentId(String parentId);
}
